#include "GameEngine.h"
#include "LifeBoardTest.h"
#include "LifeCheckerTest.h"
#include <iostream>
#define TEST false

using namespace std;

bool startLifeBoardTest(){
  LifeBoardTest test;

  if(test.resetGrid() && test.returnXRangeCorr()\
     && test.returnYRangeCorr() && test.setValueTest()\
     && test.copyTest()){
      test.~LifeBoardTest();
      return true;
  }

  test.~LifeBoardTest();
  return false;
}

bool startLifeCheckerTest(){
  LifeCheckerTest test;

  if(test.getCurXTest() && test.getCurYTest()\
     &&test.setCurXTest() && test.setCurYTest()\
     && test.lifeUpTest() && test.lifeDownTest()\
     && test.lifeRightTest() && test.lifeLeftTest()\
     && test.lifeUpRightTest() && test.lifeUpLeftTest()\
     && test.lifeDownRightTest() && test.lifeDownLeftTest()\
     && test.aliveTest()){

    test.~LifeCheckerTest();
    return true;
  }

  test.~LifeCheckerTest();
  return false;
}

void startTestSequence(){
  if(startLifeBoardTest() \
     && startLifeCheckerTest()){
      cout << "Tests Work!" << endl;
    }
    else{
      cout << "Tests Failed!" << endl;
    }
}

int main(){
    if(TEST){
      startTestSequence();
    }
    else{
      GameEngine heart;
      heart.gameRun();
    }

  return 0;
}
